//
//  USTarotLoadingView.m
//  us
//
//  Created by karry on 2025/5/14.
//

#import "USTarotLoadingView.h"

@interface USTarotLoadingView()

@property (nonatomic, strong) NSTimer *rotateTimer;

@end

@implementation USTarotLoadingView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/


- (void)awakeFromNib{
    [super awakeFromNib];
    
   
    UIColor *tintColor = [UIColor jk_colorWithHex:0xffef9c];
    self.infoLab.textColor = tintColor;
    self.titleLab.textColor = tintColor;
    self.subLab.textColor = [tintColor colorWithAlphaComponent:0.5];
    
    self.cardImageView.layer.cornerRadius = 6;
    self.cardImageView.layer.masksToBounds = YES;

    self.backgroundColor = UIColor.clearColor;
    
//   self.rotateTimer = [NSTimer scheduledTimerWithTimeInterval:1.5
//                                        target:self
//                                      selector:@selector(flipCard)
//                                      userInfo:nil
//                                       repeats:YES];
    
    
}


- (void)flipCard {
    [UIView transitionWithView:self.cardImageView
                      duration:0.5
                       options:UIViewAnimationOptionTransitionFlipFromLeft
                    animations:nil
                    completion:nil];
}

- (void)willMoveToSuperview:(UIView *)newSuperview {
    if (!newSuperview) {
        // 被移除视图时清除 timer
        [self.rotateTimer invalidate];
        self.rotateTimer = nil;
    }
    [super willMoveToSuperview:newSuperview];
}

@end
